package com.yc.sole.erp.request;

import com.yc.sole.erp.enums.PriorityType;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.List;

/**
 * @author yizuomin
 * @date 2024/3/13 21:42
 **/
@Data
public class SaleOrderSaveReq implements Serializable {

    /**
     * 客户id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long customerId;
    /**
     * 优先级 0普通 1加急
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private PriorityType priority;
    /**
     * 订单日期
     */
    @Length(max = 20, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String orderDate;
    /**
     * 订单信息
     */
    @Valid
    @NotEmpty(groups = {SaveGroup.class, UpdateGroup.class})
    private List<SaleOrderItemReq> itemList;
}
